#include "StdAfx.h"

template < typename T >
class Singleton
{
public :

    static inline T & GetInstance( void ) {
        return *Singleton::s_instance;
    }
     
protected :

    Singleton( void ) {
        Singleton::s_instance = static_cast< T * >( this );
    }

    virtual ~Singleton( void ) {
        Singleton::s_instance = NULL;
    }
         
    static T * s_instance;
};
 
template < typename T > T * Singleton< T >::s_instance = NULL;